#include <gui/batterypage_screen/BatteryPageView.hpp>
#include <gui/batterypage_screen/BatteryPagePresenter.hpp>

BatteryPagePresenter::BatteryPagePresenter(BatteryPageView& v)
    : view(v)
{

}

void BatteryPagePresenter::activate()
{
		BatteryPagePresenterState(true);	
}

void BatteryPagePresenter::deactivate()
{
		BatteryPagePresenterState(false);	
}
//物理按键的页面跳转
void BatteryPagePresenter::BatteryPageChange(uint8_t newFiveKeyFunc)
{
		view.BatteryPageChange(newFiveKeyFunc);	
}
//BatteryPagePresenter状态
void BatteryPagePresenter::BatteryPagePresenterState(bool enable)
{
		if(enable == true)
			model->BatteryPageViewTask(true);
		else
			model->BatteryPageViewTask(false);
}
//更新火焰状态
void BatteryPagePresenter::updateBatteryPageInfo(uint16_t CurrentVal, uint16_t VoltageVal)
{
		view.updateBatteryPageInfo(CurrentVal, VoltageVal);	
}